@import "variables";

seed-infinite-scroll {
  &[state='enabled'] .seed-infinite-loading,&[state='enabled'] .seed-infinite-finished,&[state='disabled'] .seed-infinite-loading {
    visibility: hidden;
  }
  &[state='disabled'] .seed-infinite-finished{
    display: block !important;
    visibility: visible !important;
  }
  &[state='disabled'] .seed-infinite-loading {
    display: none;
  }
  &[state='loading'] .seed-infinite-loading {
    display: flex;
    visibility: visible;
  }
  &[state='loading'] .seed-infinite-finished {
    display: none !important;
  }
  #seed-infinite-scroll {
    //background: color($h5,c10);
  }
  seed-infinite-scroll-content {
    text-align: center;
    @include set-color(c4);
    .seed-infinite-loading {
      padding: pxTorem(30px) 0;
      //background: color($h5, c10);
      display: flex;
      align-items: center;
      justify-content: center;

      .dotting {
        display: inline-block;
        min-width: 2px;
        min-height: 2px;
        box-shadow: 2px 0 currentColor, 6px 0 currentColor, 10px 0 currentColor;
        -webkit-animation: dot 4s infinite step-start both;
        animation: dot 1.5s infinite step-start both;
      }
      .dotting:before {
        content: '...';
      }
      .dotting::before {
        content: '';
      }
      :root .dotting {
        margin-right: 8px;
      }

      @-webkit-keyframes dot {
        25% {
          box-shadow: none;
        }
        50% {
          box-shadow: 2px 0 currentColor;
        }
        75% {
          box-shadow: 2px 0 currentColor, 6px 0 currentColor;
        }
      }
      @keyframes dot {
        25% {
          box-shadow: none;
        }
        50% {
          box-shadow: 2px 0 currentColor;
        }
        75% {
          box-shadow: 2px 0 currentColor, 6px 0 currentColor;
        }
      }
    }

    .seed-infinite-finished {
      @extend .seed-infinite-loading;
      display: none;
    }

    .spinner {
      width: 50px;
      height: 60px;
      text-align: center;
      font-size: 10px;
    }

    .spinner > div {
      background-color: color($h5,c10);
      height: 100%;
      width: 6px;
      display: inline-block;
      -webkit-animation: stretchdelay 1.2s infinite ease-in-out;
      animation: stretchdelay 1.2s infinite ease-in-out;
    }

    .spinner .rect2 {
      -webkit-animation-delay: -1.1s;
      animation-delay: -1.1s;
    }

    .spinner .rect3 {
      -webkit-animation-delay: -1.0s;
      animation-delay: -1.0s;
    }

    .spinner .rect4 {
      -webkit-animation-delay: -0.9s;
      animation-delay: -0.9s;
    }

    .spinner .rect5 {
      -webkit-animation-delay: -0.8s;
      animation-delay: -0.8s;
    }

    @-webkit-keyframes stretchdelay {
      0%, 40%, 100% { -webkit-transform: scaleY(0.4) }
      20% { -webkit-transform: scaleY(1.0) }
    }

    @keyframes stretchdelay {
      0%, 40%, 100% {
        transform: scaleY(0.4);
        -webkit-transform: scaleY(0.4);
      }  20% {
           transform: scaleY(1.0);
           -webkit-transform: scaleY(1.0);
         }
    }

    .seed-infinite-loading-spinner {
      position: relative;
      display: inline-block;
      vertical-align: middle;
      width: pxTorem(32px);
      height: pxTorem(32px);
      margin-right: pxTorem(10px);
    }

    .spinner {
      position: absolute;
      height: 100%;
      width: 100%;
      animation: b .6s infinite linear;
      border: 2px solid #eee;
      border-top-color: color($h5,c1);
      border-radius: 50%;
      box-sizing: border-box;
    }

    @keyframes b {
      0% {
        transform: rotate(0deg)
      }

      to {
        transform: rotate(1turn)
      }
    }

  }
}
